<?php if($search):?>
<h2>查询货物名称信息</h2>
<?php else:?>
<h2>修改货物名称信息</h2>
<?php endif?>
<?php echo CHtml::beginForm(array($search?'search':'admin'),'post');?>
<table  style="margin: 0 auto;"  width="850">
<tr><td>
	货物名称：<input type="text" name="keys[goods_name.name]" size="8" value="<?php echo isset($_GET['keys']['goods_name.name'])?$_GET['keys']['goods_name.name']:'';?>"/>
	货主(发货人)：<input type="text" name="keys[consignor.name]" size="8" value="<?php echo isset($_GET['keys']['consignor.name'])?$_GET['keys']['consignor.name']:'';?>"/>
	模糊查询：<input type="radio" name="keys[blur]" value="1" checked/>是  
	<input type="radio" name="keys[blur]" value="0" <?php echo isset($_GET['keys']['blur'])&&$_GET['keys']['blur']==0?'checked':'';?>/>否 
	<input type="submit" value="搜索"/>
</td></tr></table>
<?php echo CHtml::endForm();?>
<table class="dataGrid"  width="850">
  <thead>
  <tr>
    <th  width="100"><?php echo $sort->link('name'); ?></th>
    <th  width="150"><?php echo $sort->link('consignor_name'); ?></th>
    <th  width="250"><?php echo $sort->link('conditions_of_carriage'); ?></th>
    <th  width="100"><?php echo $sort->link('n_index'); ?></th>
    <th  width="150"><?php echo $sort->link('create_time'); ?></th>
	<?php if(!$search):?><th  width="100">操作</th><?php endif ?>
  </tr>
  </thead>
  <tbody>
<?php foreach($models as $n=>$model): ?>
  <tr class="<?php echo $n%2?'even':'odd';?>">
    <?php 
    	$url=array('show','id'=>$model->id)+$_GET;//把所有参数包括页码、查询参数传入显示信息页面
    	$url['ret']=$search?'search':'admin';
    ?>
    <td><?php echo CHtml::link($model->name,$url); ?></td>
    <td><?php echo CHtml::encode($model->consignor_name); ?></td>
    <td><?php echo CHtml::encode($model->conditions_of_carriage); ?></td>
    <td><?php echo CHtml::encode($model->n_index); ?></td>
    <td><?php echo CHtml::encode($model->create_time); ?></td>
    <?php if(!$search):?>
    <td>
      <?php echo CHtml::link('修改',array('update','id'=>$model->id)+$_GET); ?>
     <?php echo CHtml::link('删除',array('delete','id'=>$model->id)+$_GET,array('confirm'=>"确定要删除{$model->name}的货物名称信息吗？")); ?>
	</td>
	<?php endif ?>
  </tr>
<?php endforeach; ?>
  </tbody>
</table>
<br/>
<?php $this->widget('CLinkPager',array('pages'=>$pages,'htmlOptions'=>array('style'=>'width:850px;'))); ?>
